<!DOCTYPE html>
<html lang="ch">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>EasyServer</title>
    <script src="./js/axios.min.js"></script>
    <script src="./js/vue-2.6.10.js"></script>
    <!-- Element UI -->
    <script src="./js/index.js"></script>
    <link rel="stylesheet" href="./css/element-css/index.css">
    <link rel="stylesheet" href="./css/element-css/container.css">

    <style>
        body {
            margin: 0;
            padding: 0;
        }

        a {
            width: 100%;
            height: 100%;
            text-decoration: none;
        }
    </style>
</head>

<body>

    <div id="app">
        <el-container style="height: 100vh;">
            <el-header>Header</el-header>
            <el-container>
                <el-aside width="200px">
                    <el-menu unique-opened default-active=0 background-color="#F2F6FC">
                        <el-menu-item index="0" style="color: #409EFF;">
                            <i class="el-icon-menu"></i>
                            <span slot="title">EasyServer</span>
                        </el-menu-item>
                        <el-submenu v-for="menu in menuList" :index="menu.path">
                            <template slot="title">
                                <i :class="menu.icon"></i>
                                <span>{{ menu.title }}</span>
                            </template>
                            <template v-for="child in menu.children">
                                <el-menu-item :index="child.path" @click="clickLinkUrl(child.path)">
                                    <span>{{ child.title }}</span>
                                </el-menu-item>
                            </template>
                        </el-submenu>
                    </el-menu>
                </el-aside>
                <el-container>
                    <iframe name="right" class="el-main" :src="rightLinkUrl" width="100%" height="100%"
                        frameborder="0"></iframe>
                </el-container>
            </el-container>
        </el-container>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                rightLinkUrl: 'pages/serverList.html',
                menuList: [
                    {
                        "path": "1",
                        "title": "服务概述",
                        "icon": "el-icon-edit",
                        "children": [
                            {
                                "path": "/1-1",
                                "title": "服务列表",
                                "linkUrl": "pages/serverList.html",
                                "children": []
                            }
                        ]
                    },
                    {
                        "path": "2",
                        "title": "服务分析",
                        "icon": "el-icon-setting",
                        "children": [
                            {
                                "path": "/2-1",
                                "title": "QQQQ",
                                "linkUrl": "member.html",
                                "children": []
                            },
                            {
                                "path": "/2-2",
                                "title": "WWWW",
                                "linkUrl": "member.html",
                                "children": []
                            },
                            {
                                "path": "/2-3",
                                "title": "EEEE",
                                "linkUrl": "all-item-list.html",
                                "children": []
                            },
                        ]
                    },
                    {
                        "path": "3",
                        "title": "服务踪迹",
                        "icon": "el-icon-share",
                        "children": [
                            {
                                "path": "/3-1",
                                "title": "QQQQ",
                                "linkUrl": "report_member.html",
                                "children": []
                            },
                            {
                                "path": "/3-2",
                                "title": "WWWW",
                                "linkUrl": "report_setmeal.html",
                                "children": []
                            },
                            {
                                "path": "/3-3",
                                "title": "EEEE",
                                "linkUrl": "report_business.html",
                                "children": []
                            }
                        ]
                    }
                ]
            },
            methods: {
                clickLinkUrl(childPath) {
                    let menuIndex = childPath.charAt(1);
                    let childIndex = childPath.charAt(3);
                    var url = this.menuList[menuIndex - 1].children[childIndex - 1].linkUrl;
                    this.rightLinkUrl = url;
                }
            },
            created() {
                // axios.get("http://111.230.210.47:8000/api/article/findAll").then(res => {
                //     if (res.status === 200) {
                //         this.tableList = res.data;
                //     }
                // });
            }
        });

    </script>

</body>

</html>